package com.bdqn.dao;
import com.bdqn.pojo.SysRole;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;
public class SysRoleMapperImpl implements SysRoleMapper{
    // mybatis-spring包中提供的实现了SqlSession接口的类，用来操作数据库
    private SqlSessionTemplate sqlSession;
    @Override
    public List<SysRole> selectrole(SysRole sysRole) {
        return sqlSession.getMapper(SysRoleMapper.class).selectrole(sysRole);
    }

    @Override
    public int insertrole(SysRole sysRole) {
        return this.getSqlSession().getMapper(SysRoleMapper.class).insertrole(sysRole);
    }

    @Override
    public int delete(Integer id) {
        return this.getSqlSession().getMapper(SysRoleMapper.class).delete(id);
    }

    @Override
    public int update(SysRole sysRole) {
        return this.getSqlSession().getMapper(SysRoleMapper.class).update(sysRole);
    }

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
}
